Small man (Bill man) Personal Original, welcome to reprint, reprint please indicate the address, small man (Bill man) column address http://blog.csdn.net/bill_man
The previous article introduced the basic construction of the vertical version of the shooting game. This article is further improved. We continue to improve our game. First, we have many game elements in the vertical version of the shooting game, including the main character, bullet, and enemy, we first define all of these as a base
the Display module, and this method updates the screen display, so it's best to write together two methodsHero = Pygame.image.load ("./image/hero.gif")#Load Hero PicturesScreen.blit (Hero, (200,400))#Draw Hero Pictures in the development positionPygame.display.update ()#Update the screen display, you can see the picture of the hero just drawn in the window, it is important to remember that no matter what the image is drawn at the end of the call this method, or in the game window will not be se
they are still different. In terms of gaming, users make changes to their own equipment, and they certainly want to feel this change, but sometimes, this kind of change is hard to feel in 2D games, especially when the characters are relatively small, such as rings, necklaces, and even gloves. There are other differences, for example, although no arm or shoulder is configured separately, when using GameSprite to parse resources, I still see the indepe
to modify the constant definition to achieve uniform modification
hint : Python does not have a really meaningful constant, just by naming the convention--all letters are capitalized in time constants, not easy to modify when developing!Code Adjustment
plane_sprites.pyincrease the definition of a constant in
plane_sprites.pyimport pygame# 屏幕大小的常量SCREEN_RECT = pygame.Rect(0, 0, 480, 700)# 刷新的帧率FRAME_PER_SEC = 60class GameSprite(pyga
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.